package xgin

import (
	"github.com/gin-gonic/gin"
)

var engine *gin.Engine

func SetEngine(in *gin.Engine) {
	engine = in
}

// GetPath
// 获取请求路径，支持full path
func GetPath(ctx *gin.Context) string {
	path := ctx.FullPath()
	if path != "" {
		return path
	}

	return ctx.Request.URL.Path
}
